package com.kyle.cyledemomebius.service;


import com.kyle.cyledemomebius.mapper.DemoTableMapper;
import com.kyle.cyledemomebius.pojo.DemoTableVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@EnableAsync
public class AsyncService {

    @Resource
    private DemoTableMapper demoTableMapper;

    @Async
    public void asyncMethod()  {
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        List<DemoTableVO> demoTableVOS = demoTableMapper.updateList("00010001000");
        System.out.println(demoTableVOS);

    }

    public void mebiusMethod() {
        System.out.println("追溯测试----修改之前");
    }
}
